package wviz.index;

/**
 * Ngram strings (normally words or stemmed words)
 * and a score indicating how useful
 * the string is likely to be in a classification task 
 */
public class StringWithIntScore implements Comparable {
    private final String word;
    private int score;

    public int compareTo(Object o) {
        final StringWithIntScore ng = (StringWithIntScore) o;

        if (ng.score > score) {
            return 1;
        } else
        if (ng.score < score) {
            return -1;
        } else {
            return ng.word.compareTo(word);
        }
    }

    public StringWithIntScore(String ng, int d) {
        word = ng;
        score = d;
    }
    public int getScore(){
    	return score;
    }
    
    public String getWord() {
    	return word;
    }

//    public void setScore(double score) {
//        this.score = score;
//    }

    public String toString(){
    	return word + " " + score;

    }
}